#include <stdio.h>
#include <string.h>

char* func1() {
    char* p = "hello";
    return p;
}

char* func2() {
    char p[] = "hello";
    return p;
}

char* func3()
{
    char* p = new char[strlen("hello") + 1];
    strcpy(p, "hello");
    return p;
}

char* func4()
{
    static char* p = nullptr;
    if (p == nullptr) {
        p = new char[strlen("hello") + 1];
        strcpy(p, "hello");
    }
    return p;
}

void func5(char* p)
{
    p = new char[strlen("hello") + 1];
    strcpy(p, "hello");
}

void func6(char** p)
{
    *p = new char[strlen("hello") + 1];
    strcpy(*p, "hello");
}

int main() {
    int n;
    scanf("%d", &n);
    while (n>0 && n <= 6) {
        char* p;
        if (n == 1) {
            p = func1();
        }
        else if (n == 2) {
            p = func2();
        }
        else if (n == 3) {
            p = func3();
        }
        else if (n == 4) {
            p = func4();
        }
        else if (n == 5) {
            func5(p);
        }
        else if (n == 6) {
            func6(&p);
        }
        printf("p = %s\n", p);
        delete p;

        scanf("%d", &n);
    }
    printf("bye\n");
    return 0;
}
